<!DOCTYPE html>
<html lang=en>
<head>
    <!-- so meta -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="HandheldFriendly" content="True">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
    <meta name="description" content="在excel开发中一些常用的方法。 excel的索引是从1开始的，单元格个行列，worksheet顺序等等 获取选择的单元格 Excel.Range r &#x3D; (Excel.Range)Application.ActiveCell; 获取指定单元格 wks是当前活动的Worksheet Excel.Range cell1 &#x3D; (Excel.Range)wks.Cells[next_row, 1];">
<meta property="og:type" content="article">
<meta property="og:title" content="vsto技巧杂烩">
<meta property="og:url" content="http://yoursite.com/2018/03/11/vsto%E6%8A%80%E5%B7%A7%E6%9D%82%E7%83%A9/index.html">
<meta property="og:site_name" content="TmoonSite">
<meta property="og:description" content="在excel开发中一些常用的方法。 excel的索引是从1开始的，单元格个行列，worksheet顺序等等 获取选择的单元格 Excel.Range r &#x3D; (Excel.Range)Application.ActiveCell; 获取指定单元格 wks是当前活动的Worksheet Excel.Range cell1 &#x3D; (Excel.Range)wks.Cells[next_row, 1];">
<meta property="og:locale" content="en_US">
<meta property="article:published_time" content="2018-03-11T14:49:20.000Z">
<meta property="article:modified_time" content="2020-01-07T10:48:14.804Z">
<meta property="article:author" content="Tmoonlight">
<meta name="twitter:card" content="summary">
    
    
        
          
              <link rel="shortcut icon" href="/images/favicon.ico">
          
        
        
          
            <link rel="icon" type="image/png" href="/images/logo2.gif" sizes="192x192">
          
        
        
          
            <link rel="apple-touch-icon" sizes="180x180" href="/images/logo2.gif">
          
        
    
    <!-- title -->
    <title>vsto技巧杂烩</title>
    <!-- styles -->
    
<link rel="stylesheet" href="/css/style.css">

    <!-- persian styles -->
    
      
<link rel="stylesheet" href="/css/rtl.css">

    
    <!-- rss -->
    
    
<meta name="generator" content="Hexo 4.2.0"></head>

<body class="max-width mx-auto px3 ltr">
    
      <div id="header-post">
  <a id="menu-icon" href="#"><i class="fas fa-bars fa-lg"></i></a>
  <a id="menu-icon-tablet" href="#"><i class="fas fa-bars fa-lg"></i></a>
  <a id="top-icon-tablet" href="#" onclick="$('html, body').animate({ scrollTop: 0 }, 'fast');" style="display:none;"><i class="fas fa-chevron-up fa-lg"></i></a>
  <span id="menu">
    <span id="nav">
      <ul>
         
          <li><a href="/">Home</a></li>
         
          <li><a href="/about/">About</a></li>
         
          <li><a href="/archives/">Writing</a></li>
         
          <li><a href="/projects_url">Projects</a></li>
        
      </ul>
    </span>
    <br/>
    <span id="actions">
      <ul>
        
        <li><a class="icon" href="/2018/03/27/%E6%95%B0%E6%8D%AE%E6%81%A2%E5%A4%8D/"><i class="fas fa-chevron-left" aria-hidden="true" onmouseover="$('#i-prev').toggle();" onmouseout="$('#i-prev').toggle();"></i></a></li>
        
        
        <li><a class="icon" href="/2018/03/03/System.ComponentModel.Annotations4.4.0%E5%9C%A8%E6%96%B0%E7%89%88%E6%9C%AC.netcore%E4%B8%AD%E6%89%BE%E4%B8%8D%E5%88%B0%E5%BC%95%E7%94%A8%E7%9A%84%E9%97%AE%E9%A2%98/"><i class="fas fa-chevron-right" aria-hidden="true" onmouseover="$('#i-next').toggle();" onmouseout="$('#i-next').toggle();"></i></a></li>
        
        <li><a class="icon" href="#" onclick="$('html, body').animate({ scrollTop: 0 }, 'fast');"><i class="fas fa-chevron-up" aria-hidden="true" onmouseover="$('#i-top').toggle();" onmouseout="$('#i-top').toggle();"></i></a></li>
        <li><a class="icon" href="#"><i class="fas fa-share-alt" aria-hidden="true" onmouseover="$('#i-share').toggle();" onmouseout="$('#i-share').toggle();" onclick="$('#share').toggle();return false;"></i></a></li>
      </ul>
      <span id="i-prev" class="info" style="display:none;">Previous post</span>
      <span id="i-next" class="info" style="display:none;">Next post</span>
      <span id="i-top" class="info" style="display:none;">Back to top</span>
      <span id="i-share" class="info" style="display:none;">Share post</span>
    </span>
    <br/>
    <div id="share" style="display: none">
      <ul>
  <li><a class="icon" href="http://www.facebook.com/sharer.php?u=http://yoursite.com/2018/03/11/vsto%E6%8A%80%E5%B7%A7%E6%9D%82%E7%83%A9/" target="_blank" rel="noopener"><i class="fab fa-facebook " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="https://twitter.com/share?url=http://yoursite.com/2018/03/11/vsto%E6%8A%80%E5%B7%A7%E6%9D%82%E7%83%A9/&text=vsto技巧杂烩" target="_blank" rel="noopener"><i class="fab fa-twitter " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://www.linkedin.com/shareArticle?url=http://yoursite.com/2018/03/11/vsto%E6%8A%80%E5%B7%A7%E6%9D%82%E7%83%A9/&title=vsto技巧杂烩" target="_blank" rel="noopener"><i class="fab fa-linkedin " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="https://pinterest.com/pin/create/bookmarklet/?url=http://yoursite.com/2018/03/11/vsto%E6%8A%80%E5%B7%A7%E6%9D%82%E7%83%A9/&is_video=false&description=vsto技巧杂烩" target="_blank" rel="noopener"><i class="fab fa-pinterest " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="mailto:?subject=vsto技巧杂烩&body=Check out this article: http://yoursite.com/2018/03/11/vsto%E6%8A%80%E5%B7%A7%E6%9D%82%E7%83%A9/"><i class="fas fa-envelope " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="https://getpocket.com/save?url=http://yoursite.com/2018/03/11/vsto%E6%8A%80%E5%B7%A7%E6%9D%82%E7%83%A9/&title=vsto技巧杂烩" target="_blank" rel="noopener"><i class="fab fa-get-pocket " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://reddit.com/submit?url=http://yoursite.com/2018/03/11/vsto%E6%8A%80%E5%B7%A7%E6%9D%82%E7%83%A9/&title=vsto技巧杂烩" target="_blank" rel="noopener"><i class="fab fa-reddit " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://www.stumbleupon.com/submit?url=http://yoursite.com/2018/03/11/vsto%E6%8A%80%E5%B7%A7%E6%9D%82%E7%83%A9/&title=vsto技巧杂烩" target="_blank" rel="noopener"><i class="fab fa-stumbleupon " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://digg.com/submit?url=http://yoursite.com/2018/03/11/vsto%E6%8A%80%E5%B7%A7%E6%9D%82%E7%83%A9/&title=vsto技巧杂烩" target="_blank" rel="noopener"><i class="fab fa-digg " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://www.tumblr.com/share/link?url=http://yoursite.com/2018/03/11/vsto%E6%8A%80%E5%B7%A7%E6%9D%82%E7%83%A9/&name=vsto技巧杂烩&description=" target="_blank" rel="noopener"><i class="fab fa-tumblr " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="https://news.ycombinator.com/submitlink?u=http://yoursite.com/2018/03/11/vsto%E6%8A%80%E5%B7%A7%E6%9D%82%E7%83%A9/&t=vsto技巧杂烩" target="_blank" rel="noopener"><i class="fab fa-hacker-news " aria-hidden="true"></i></a></li>
</ul>

    </div>
    <div id="toc">
      
    </div>
  </span>
</div>

    
    <div class="content index py4">
        
        <article class="post" itemscope itemtype="http://schema.org/BlogPosting">
  <header>
    
    <h1 class="posttitle" itemprop="name headline">
        vsto技巧杂烩
    </h1>



    <div class="meta">
      <span class="author" itemprop="author" itemscope itemtype="http://schema.org/Person">
        <span itemprop="name">TmoonSite</span>
      </span>
      
    <div class="postdate">
      
        <time datetime="2018-03-11T14:49:20.000Z" itemprop="datePublished">2018-03-11</time>
        
      
    </div>


      

      

    </div>
  </header>
  

  <div class="content" itemprop="articleBody">
    <p>在excel开发中一些常用的方法。</p>
<p>excel的索引是从1开始的，单元格个行列，worksheet顺序等等</p>
<p>获取选择的单元格</p>
<p>Excel.Range r = (Excel.Range)Application.ActiveCell;</p>
<p>获取指定单元格</p>
<p>wks是当前活动的Worksheet</p>
<p>Excel.Range cell1 = (Excel.Range)wks.Cells[next_row, 1];</p>
<p>删除一行</p>
<p>Excel.Range sel_row_range = (Excel.Range)wks.Rows[“2:2”, Type.Missing];</p>
<p>//删除第二行</p>
<p>sel_row_range.Delete(Excel.XlDeleteShiftDirection.xlShiftUp);</p>
<p>设置range颜色</p>
<p>Excel.Range range = this.Cells[1, 1];</p>
<p>range.Interior.Color = 0x00ff00;</p>
<p>0x0000ff 红色</p>
<p>0x00ff00 绿色</p>
<p>0xff0000 蓝色</p>
<p>设置单元格计算函数</p>
<p>//显示计算结果的单元格</p>
<p>Excel.Range math_range = get_Range(“A5”,”A5”);</p>
<p>//设置单元格表达式</p>
<p>math_range.FormulaR1C1 = “=CalculateArea(R[-2]C[-1]:R[-2]C)”;</p>
<p>R[-2]C[-1]:R[-2]C</p>
<p>意思是，从当前单元格开始算行数为当前行-2，列数为当前列-1，到达单元格为当前行-2，和当前列相等</p>
<p>设置单元格类型</p>
<p>//设置单元格类型为文本</p>
<p>cell2.NumberFormatLocal = “@”;</p>
<p>设置公式</p>
<p>例 E3=B3*D3</p>
<p>Excel.Range r = (Excel.Range)wks.cells[3,5];</p>
<p>r.FormulaR1C1 = “=RC[-3]*RC[-1]”;</p>
<p>设置区域字体</p>
<p>private void SetRangeFont(Excel.Range range, string font_name, int font_size)</p>
<p>{</p>
<p>Excel.Font target_font = range.Font;</p>
<p>target_font.Name = font_name;</p>
<p>target_font.Size = font_size;</p>
<p>target_font.Strikethrough = false;</p>
<p>target_font.Superscript = false;</p>
<p>target_font.Subscript = false;</p>
<p>target_font.OutlineFont = false;</p>
<p>target_font.Shadow = false;</p>
<p>target_font.Underline = Excel.XlUnderlineStyle.xlUnderlineStyleNone;</p>
<p>target_font.ThemeColor = Excel.XlThemeColor.xlThemeColorLight1;</p>
<p>target_font.TintAndShade = 0;</p>
<p>target_font.ThemeFont = Excel.XlThemeFont.xlThemeFontNone;</p>
<p>}</p>
<p>设置选择单元格</p>
<p>Excel.Range range = this.Cells[1, 1];</p>
<p>range.Select();</p>
<p>设置选择行</p>
<p>Excel.Range range = (Excel.Range)this.Rows[1, missing];</p>
<p>range.Select();</p>
<p>通过代号获取range</p>
<p>Excel.Range range = get_Range(“A1”, “B3”);</p>
<p>设置Range的详细属性，包括颜色，是否边框为黑色实线等</p>
<p>private void SetRangeColor(Excel.Range range,Excel.XlThemeColor color)</p>
<p>{</p>
<p>range.Interior.Pattern = Excel.XlPattern.xlPatternSolid;</p>
<p>range.Interior.PatternColorIndex = Excel.XlPattern.xlPatternAutomatic;</p>
<p>range.Interior.ThemeColor = color;</p>
<p>range.Interior.TintAndShade = 0.89999;</p>
<p>range.Interior.PatternTintAndShade = 0;</p>
<p>range.Borders[Excel.XlBordersIndex.xlDiagonalDown].LineStyle = Excel.XlLineStyle.xlLineStyleNone;</p>
<p>range.Borders[Excel.XlBordersIndex.xlDiagonalUp].LineStyle = Excel.XlLineStyle.xlLineStyleNone;</p>
<p>range.Borders[Excel.XlBordersIndex.xlEdgeLeft].LineStyle = Excel.XlLineStyle.xlLineStyleNone;</p>
<p>range.Borders[Excel.XlBordersIndex.xlEdgeTop].LineStyle = Excel.XlLineStyle.xlLineStyleNone;</p>
<p>range.Borders[Excel.XlBordersIndex.xlEdgeBottom].LineStyle = Excel.XlLineStyle.xlContinuous;</p>
<p>range.Borders[Excel.XlBordersIndex.xlEdgeBottom].ColorIndex = 0;</p>
<p>range.Borders[Excel.XlBordersIndex.xlEdgeBottom].TintAndShade = 0;</p>
<p>range.Borders[Excel.XlBordersIndex.xlEdgeBottom].Weight = Excel.XlBorderWeight.xlThin;</p>
<p>range.Borders[Excel.XlBordersIndex.xlEdgeRight].LineStyle = Excel.XlLineStyle.xlLineStyleNone;</p>
<p>range.Borders[Excel.XlBordersIndex.xlInsideVertical].LineStyle = Excel.XlLineStyle.xlLineStyleNone;</p>
<p>range.Borders[Excel.XlBordersIndex.xlInsideHorizontal].LineStyle = Excel.XlLineStyle.xlLineStyleNone;</p>
<p>range.Borders[Excel.XlBordersIndex.xlDiagonalDown].LineStyle = Excel.XlLineStyle.xlLineStyleNone;</p>
<p>range.Borders[Excel.XlBordersIndex.xlDiagonalUp].LineStyle = Excel.XlLineStyle.xlLineStyleNone;</p>
<p>range.Borders[Excel.XlBordersIndex.xlEdgeLeft].LineStyle = Excel.XlLineStyle.xlContinuous;</p>
<p>range.Borders[Excel.XlBordersIndex.xlEdgeLeft].ColorIndex = 0;</p>
<p>range.Borders[Excel.XlBordersIndex.xlEdgeLeft].TintAndShade = 0;</p>
<p>range.Borders[Excel.XlBordersIndex.xlEdgeLeft].Weight = Excel.XlBorderWeight.xlThin;</p>
<p>range.Borders[Excel.XlBordersIndex.xlEdgeTop].LineStyle = Excel.XlLineStyle.xlContinuous;</p>
<p>range.Borders[Excel.XlBordersIndex.xlEdgeTop].ColorIndex = 0;</p>
<p>range.Borders[Excel.XlBordersIndex.xlEdgeTop].TintAndShade = 0;</p>
<p>range.Borders[Excel.XlBordersIndex.xlEdgeTop].Weight = Excel.XlBorderWeight.xlThin;</p>
<p>range.Borders[Excel.XlBordersIndex.xlEdgeBottom].LineStyle = Excel.XlLineStyle.xlContinuous;</p>
<p>range.Borders[Excel.XlBordersIndex.xlEdgeBottom].ColorIndex = 0;</p>
<p>range.Borders[Excel.XlBordersIndex.xlEdgeBottom].TintAndShade = 0;</p>
<p>range.Borders[Excel.XlBordersIndex.xlEdgeBottom].Weight = Excel.XlBorderWeight.xlThin;</p>
<p>range.Borders[Excel.XlBordersIndex.xlEdgeRight].LineStyle = Excel.XlLineStyle.xlContinuous;</p>
<p>range.Borders[Excel.XlBordersIndex.xlEdgeRight].ColorIndex = 0;</p>
<p>range.Borders[Excel.XlBordersIndex.xlEdgeRight].TintAndShade = 0;</p>
<p>range.Borders[Excel.XlBordersIndex.xlEdgeRight].Weight = Excel.XlBorderWeight.xlThin;</p>
<p>range.Borders[Excel.XlBordersIndex.xlInsideVertical].LineStyle = Excel.XlLineStyle.xlContinuous;</p>
<p>range.Borders[Excel.XlBordersIndex.xlInsideVertical].ColorIndex = 0;</p>
<p>range.Borders[Excel.XlBordersIndex.xlInsideVertical].TintAndShade = 0;</p>
<p>range.Borders[Excel.XlBordersIndex.xlInsideVertical].Weight = Excel.XlBorderWeight.xlThin;</p>
<p>range.Borders[Excel.XlBordersIndex.xlInsideHorizontal].LineStyle = Excel.XlLineStyle.xlContinuous;</p>
<p>range.Borders[Excel.XlBordersIndex.xlInsideHorizontal].ColorIndex = 0;</p>
<p>range.Borders[Excel.XlBordersIndex.xlInsideHorizontal].TintAndShade = 0;</p>
<p>range.Borders[Excel.XlBordersIndex.xlInsideHorizontal].Weight = Excel.XlBorderWeight.xlThin;</p>
<p>}</p>
<p>隐藏</p>
<p>Excel.Range child_range = (Excel.Range)wks.Rows[“3:3”, Type.Missing];</p>
<p>child_range.EntireRow.Hidden = true;</p>
<p>另存并加载到当前</p>
<p>wk.SaveAs(file_path, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Excel.XlSaveAsAccessMode.xlNoChange, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing);</p>
<p>另存不加载到当前</p>
<p>wk.SaveCopyAs(file_path);</p>
<p>合并单元格</p>
<p>private void MergeCells(string col_name, int start_row, int end_row)</p>
<p>{</p>
<p>Excel.Worksheet wks = m_excell_app.ActiveSheet as Excel.Worksheet;</p>
<p>string str1 = col_name + start_row.ToString();</p>
<p>string str2 = col_name + end_row.ToString();</p>
<p>Excel.Range r1 = (Excel.Range)wks.get_Range(str1, str2);</p>
<p>r1.Merge(Type.Missing);</p>
<p>}</p>
<p>设置居中，靠左</p>
<p>range.HorizontalAlignment = Excel.XlHAlign.xlHAlignLeft;</p>
<p>range.HorizontalAlignment = Excel.XlHAlign.xlHAlignCenter;</p>
<p>设置上锁区域</p>
<p>Excel.Worksheet wks = m_excell_app.ActiveSheet as Excel.Worksheet;</p>
<p>foreach (Excel.AllowEditRange aer in wks.Protection.AllowEditRanges)</p>
<p>{</p>
<p>aer.Delete();</p>
<p>}</p>
<p>wks.Protection.AllowEditRanges.Add(“s”, (Excel.Range)wks.Columns[“C:H”, Type.Missing], Type.Missing);</p>
<p>wks.Protection.AllowEditRanges.Add(“s1”, (Excel.Range)wks.Columns[“X:AR”, Type.Missing], Type.Missing);</p>
<p>int i = 2;</p>
<p>foreach (Excel.Range e in wks.UsedRange.Rows)</p>
<p>{</p>
<p>Excel.Range cell = (Excel.Range)wks.Cells[e.Row, 17];</p>
<p>if (cell.Value2 == null)</p>
<p>{</p>
<p>wks.Protection.AllowEditRanges.Add(“s” + i.ToString(), cell, Type.Missing);</p>
<p>i++;</p>
<p>}</p>
<p>else</p>
<p>{</p>
<p>try</p>
<p>{</p>
<p>Convert.ToDouble(cell.FormulaR1C1.ToString());</p>
<p>wks.Protection.AllowEditRanges.Add(“s” + i.ToString(), cell, Type.Missing);</p>
<p>i++;</p>
<p>}</p>
<p>catch (Exception ex)</p>
<p>{</p>
<p>}</p>
<p>}</p>
<p>}</p>
<p>wks.Protect(Type.Missing, true, true, false, false, false, false, false, false, false, false, false, false, false, false, false);\</p>
<p>=======</p>
<p>移动worksheet</p>
<p><a href="https://docs.microsoft.com/sr-latn-rs/visualstudio/vsto/how-to-programmatically-move-worksheets-within-workbooks?view=vs-2019" target="_blank" rel="noopener">https://docs.microsoft.com/sr-latn-rs/visualstudio/vsto/how-to-programmatically-move-worksheets-within-workbooks?view=vs-2019</a>  </p>

  </div>
</article>



        
          <div id="footer-post-container">
  <div id="footer-post">

    <div id="nav-footer" style="display: none">
      <ul>
         
          <li><a href="/">Home</a></li>
         
          <li><a href="/about/">About</a></li>
         
          <li><a href="/archives/">Writing</a></li>
         
          <li><a href="/projects_url">Projects</a></li>
        
      </ul>
    </div>

    <div id="toc-footer" style="display: none">
      
    </div>

    <div id="share-footer" style="display: none">
      <ul>
  <li><a class="icon" href="http://www.facebook.com/sharer.php?u=http://yoursite.com/2018/03/11/vsto%E6%8A%80%E5%B7%A7%E6%9D%82%E7%83%A9/" target="_blank" rel="noopener"><i class="fab fa-facebook fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="https://twitter.com/share?url=http://yoursite.com/2018/03/11/vsto%E6%8A%80%E5%B7%A7%E6%9D%82%E7%83%A9/&text=vsto技巧杂烩" target="_blank" rel="noopener"><i class="fab fa-twitter fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://www.linkedin.com/shareArticle?url=http://yoursite.com/2018/03/11/vsto%E6%8A%80%E5%B7%A7%E6%9D%82%E7%83%A9/&title=vsto技巧杂烩" target="_blank" rel="noopener"><i class="fab fa-linkedin fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="https://pinterest.com/pin/create/bookmarklet/?url=http://yoursite.com/2018/03/11/vsto%E6%8A%80%E5%B7%A7%E6%9D%82%E7%83%A9/&is_video=false&description=vsto技巧杂烩" target="_blank" rel="noopener"><i class="fab fa-pinterest fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="mailto:?subject=vsto技巧杂烩&body=Check out this article: http://yoursite.com/2018/03/11/vsto%E6%8A%80%E5%B7%A7%E6%9D%82%E7%83%A9/"><i class="fas fa-envelope fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="https://getpocket.com/save?url=http://yoursite.com/2018/03/11/vsto%E6%8A%80%E5%B7%A7%E6%9D%82%E7%83%A9/&title=vsto技巧杂烩" target="_blank" rel="noopener"><i class="fab fa-get-pocket fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://reddit.com/submit?url=http://yoursite.com/2018/03/11/vsto%E6%8A%80%E5%B7%A7%E6%9D%82%E7%83%A9/&title=vsto技巧杂烩" target="_blank" rel="noopener"><i class="fab fa-reddit fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://www.stumbleupon.com/submit?url=http://yoursite.com/2018/03/11/vsto%E6%8A%80%E5%B7%A7%E6%9D%82%E7%83%A9/&title=vsto技巧杂烩" target="_blank" rel="noopener"><i class="fab fa-stumbleupon fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://digg.com/submit?url=http://yoursite.com/2018/03/11/vsto%E6%8A%80%E5%B7%A7%E6%9D%82%E7%83%A9/&title=vsto技巧杂烩" target="_blank" rel="noopener"><i class="fab fa-digg fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://www.tumblr.com/share/link?url=http://yoursite.com/2018/03/11/vsto%E6%8A%80%E5%B7%A7%E6%9D%82%E7%83%A9/&name=vsto技巧杂烩&description=" target="_blank" rel="noopener"><i class="fab fa-tumblr fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="https://news.ycombinator.com/submitlink?u=http://yoursite.com/2018/03/11/vsto%E6%8A%80%E5%B7%A7%E6%9D%82%E7%83%A9/&t=vsto技巧杂烩" target="_blank" rel="noopener"><i class="fab fa-hacker-news fa-lg" aria-hidden="true"></i></a></li>
</ul>

    </div>

    <div id="actions-footer">
        <a id="menu" class="icon" href="#" onclick="$('#nav-footer').toggle();return false;"><i class="fas fa-bars fa-lg" aria-hidden="true"></i> Menu</a>
        <a id="toc" class="icon" href="#" onclick="$('#toc-footer').toggle();return false;"><i class="fas fa-list fa-lg" aria-hidden="true"></i> TOC</a>
        <a id="share" class="icon" href="#" onclick="$('#share-footer').toggle();return false;"><i class="fas fa-share-alt fa-lg" aria-hidden="true"></i> Share</a>
        <a id="top" style="display:none" class="icon" href="#" onclick="$('html, body').animate({ scrollTop: 0 }, 'fast');"><i class="fas fa-chevron-up fa-lg" aria-hidden="true"></i> Top</a>
    </div>

  </div>
</div>

        
        <footer id="footer">
  <div class="footer-left">
    Copyright &copy; 2020 Tmoonlight
  </div>
  <div class="footer-right">
    <nav>
      <ul>
         
          <li><a href="/">Home</a></li>
         
          <li><a href="/about/">About</a></li>
         
          <li><a href="/archives/">Writing</a></li>
         
          <li><a href="/projects_url">Projects</a></li>
        
      </ul>
    </nav>
  </div>
</footer>

    </div>
    <!-- styles -->

<link rel="stylesheet" href="/lib/font-awesome/css/all.min.css">


<link rel="stylesheet" href="/lib/justified-gallery/css/justifiedGallery.min.css">


    <!-- jquery -->

<script src="/lib/jquery/jquery.min.js"></script>


<script src="/lib/justified-gallery/js/jquery.justifiedGallery.min.js"></script>

<!-- clipboard -->

  
<script src="/lib/clipboard/clipboard.min.js"></script>

  <script type="text/javascript">
  $(function() {
    // copy-btn HTML
    var btn = "<span class=\"btn-copy tooltipped tooltipped-sw\" aria-label=\"Copy to clipboard!\">";
    btn += '<i class="far fa-clone"></i>';
    btn += '</span>'; 
    // mount it!
    $(".highlight table").before(btn);
    var clip = new ClipboardJS('.btn-copy', {
      text: function(trigger) {
        return Array.from(trigger.nextElementSibling.querySelectorAll('.code')).reduce((str,it)=>str+it.innerText+'\n','')
      }
    });
    clip.on('success', function(e) {
      e.trigger.setAttribute('aria-label', "Copied!");
      e.clearSelection();
    })
  })
  </script>


<script src="/js/main.js"></script>

<!-- search -->

<!-- Google Analytics -->

<!-- Baidu Analytics -->

<!-- Disqus Comments -->


</body>
</html>
